<?php
	switch($widgetId){
		case 1:
?>
		<div class="box">
			<div class="box-heading">Categories</div>
			<div class="box-content box-category">
				<ul>
					<?php foreach ($categories as $category) { ?>
					<li>
						<?php if ($category['category_id'] == $category_id) { ?>
						<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
						<?php } else { ?>
						<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
						<?php } ?>
						<?php if ($category['children']) { ?>
						<ul>
							<?php foreach ($category['children'] as $child) { ?>
							<li>
								<?php if ($child['category_id'] == $child_id) { ?>
								<a href="<?php echo $child['href']; ?>" class="active"><?php echo $child['name']; ?></a>
								<?php } else { ?>
								<a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
								<?php } ?>
							</li>
							<?php } ?>
						</ul>
					<?php } ?>
					</li>
					<?php } ?>
				</ul>
			</div>
		</div>
<?php
		break;
			
		case 2:
?>


		<div class="box">
		  <div class="box-heading">Favourite Links</div>
		  <div class="box-content box-category">
			<ul>
			<?php foreach ($favouriate_links as $flinks) { ?>
				<li>
				<a href="http://<?php echo str_replace('http://','',$flinks['href']); ?>" <?php echo (int)$flinks['target']==1?'target="_blank"':''?>><?php echo $flinks['name']; ?></a>
				</li>
			<?php } ?>
			</ul>
		  </div>
		</div>

<?php
		break;
		
		case 3:
?>


		<div class="box">
		  <div class="box-heading">Archives</div>
		  <div class="box-content box-category">
			 <ul>
				<?php foreach ($archieves as $archieve) { ?>
				<li>
				  <?php if ($archieve['archieve_id'] == $year) { ?>
				  <a href="<?php echo $archieve['href']; ?>" class="active"><?php echo $archieve['name']; ?></a>
				  <?php } else { ?>
				  <a href="<?php echo $archieve['href']; ?>"><?php echo $archieve['name']; ?></a>
				  <?php } ?>
				  <?php if ($archieve['children']) { ?>
				  <ul>
					<?php foreach ($archieve['children'] as $child) { ?>
					<li>
					  <?php if ($child['archieve_id'] == $month) { ?>
					  <a href="<?php echo $child['href']; ?>" class="active"><?php echo $child['name']; ?></a>
					  <?php } else { ?>
					  <a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
					  <?php } ?>
					</li>
					<?php } ?>
				  </ul>
				  <?php } ?>
				</li>
				<?php } ?>
			  </ul>
		  </div>
		</div>
<?php
		break;
	}
?>
